import 'package:encrypt/encrypt.dart';

class EcyEncrptyUtil {
  /*aes加密*/
  static String aesEncode(String input) {
    // 用户注册时密码加密方式:AES
    // mode=CBC
    // padding=PKCS7Padding
    // key=dKZVgNNs267Fr*BfXDxDK8Kt
    // iv=AWpf2TE^wBTbPGXq
    final plainText = input;
    final key = Key.fromUtf8('dKZVgNNs267Fr*BfXDxDK8Kt');
    final iv = IV.fromUtf8("AWpf2TE^wBTbPGXq");
    final encrypter = Encrypter(AES(key, mode: AESMode.cbc));
    final encrypted = encrypter.encrypt(plainText, iv: iv);
    return encrypted.base64;
  }
}
